#http://www.mathchina.com/bbs/forum.php?mod=viewthread&tid=2044556&amp;page=1&;extra=#pid2395817
# 求各 ai 严格递增的解，并限制每个 ai 都满足 fa < ai <= fb
b = [[1,2,3]]
fa = 3; fb = 5;
for k=4:100
    global b, fa, fb
    result = []; t = 0;
    for u=1:length(b)
        for i=1:length(b[u])-1
            t1 = b[u][i]
            for j=i+1:length(b[u])
                t2 = b[u][j]
                s = t1 + t2
                if s > fa
                    tp = copy(b[u]); tp = append!(tp, s)
                    append!(result, [tp])
                end   
            end
        end
    end
    b=unique(result)
    sort!(b, lt=(x, y)->isless(x[end], y[end]))
    for j=1:length(b)
        t += 1
        if j == length(b) || b[j][end] < b[j+1][end]
            println("k = $k, $(b[j])")
            println("n = $(b[j][end]), sol = $t\n")
            t = 0
        else
            println("k = $k, $(b[j])")
        end   
    end
    fb, fa = fb + fa, fb
end
